// components.cpp : contains a function to register components with a component manager
//$Id: Components.cpp 25 2009-08-21 02:02:10Z brwarner2 $
#include "stdafx.h"
#include "Components.h"
#include "ComponentManager.h"

//Include all components
#include "Entity.h"
#include "Render.h"
#include "Input.h"
#include "Physics.h"
#include "Portal.h"

void RegisterComponents(CComponentManager* pCM)
{
	pCM->Register<CEntity>();
	pCM->Register<CRender>();
	pCM->Register<CInput>();
	pCM->Register<CPhysics>();
	pCM->Register<CPortal>();
}

void RegisterComponentIDs( gmMachine& gm )
{
	//Get global list
	gmTableObject* globals = gm.GetGlobals();

	//Register each id
	globals->Set(&gm, "COMPONENT_ENTITY", gmVariable((int)CEntity::COMPONENT_ID));
	globals->Set(&gm, "COMPONENT_RENDER", gmVariable((int)CRender::COMPONENT_ID));
	globals->Set(&gm, "COMPONENT_INPUT", gmVariable((int)CInput::COMPONENT_ID));
	globals->Set(&gm, "COMPONENT_PHYSICS", gmVariable((int)CPhysics::COMPONENT_ID));
	globals->Set(&gm, "COMPONENT_PORTAL", gmVariable((int)CPortal::COMPONENT_ID));
}